#include <stdio.h>
#include "string.h"
#include "stdlib.h"
char *my3cat(char *a,char *b,char *c){
    int ln,i;
    char *p;
    if(!a || !b || !c)
        return NULL;
    ln=strlen(a)+strlen(b)+strlen(c);
    if((p=(char *)malloc(sizeof(char)*ln+1))==NULL){
        printf("Application memory failure...\n");
        return NULL;
    }
    for(i=ln=0;a[i];p[ln++]=a[i++]);
    for(i=0;b[i];p[ln++]=b[i++]);
    for(i=0;p[ln++]=c[i++];);
    return p;
}
int main(void){
    char a[100],b[100],c[100],*p;
    printf("Input 3 strings...\n");
    scanf("%100s%100s%100s",a,b,c);
    printf("The result is %s\n",p=my3cat(a,b,c));
    free(p);
    return 0;
}